package email;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */



import org.apache.commons.mail.EmailException;
import org.apache.commons.mail.SimpleEmail;

/**
 *
 * @author williambartko
 */


  public class TesteCommons {

      public static void main(String[] args) {

          SimpleEmail email = new SimpleEmail();

          try {
          email.setDebug(true);
          email.setHostName("smtp.gmail.com");
          email.setAuthentication("smjfcm@gmail.com","futebolNaWebSMJF");
          email.setSSL(true);
          email.addTo("williambartko@gmail.com"); //pode ser qualquer um email
          email.setFrom("smjfcm@gmail.com"); //aqui necessita ser o email que voce fara a autenticacao
          email.setSubject("Teste");
          email.setMsg("Outro teste");
          email.send();

          } catch (EmailException e) {

          System.out.println(e.getMessage());

          }

      }
  }
